#include<bits/stdc++.h>

using namespace std;
using ll = long long;
#define endl '\n'

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
//算法 O(nlogn）最大计算n=1e7-1e8规模
    ll M, p, q, k, s;
    //p+(p+1)+...+q=M
    cin >> M;
    for (p = 1; p <= M / 2; p++) {
        ll left = p + 1, right = M;


        while (left <= right) {
            q = (left + right) / 2;
            s = (q - p + 1) * (q + p) / 2;
            if (s == M) {
                cout << p << " " << q << endl;
                break;
            } else if (s > M) {
                right = q - 1;
            } else {
                left = q + 1;
            }

        }


    }


    return 0;
}

